#include "CannyEdgeFilter.h"

CannyEdgeFilter::CannyEdgeFilter(double threshold1, double threshold2, int apertureSize) {

	assert(apertureSize == 1
		|| apertureSize == 3
		|| apertureSize == 5
		|| apertureSize == 7
		);

	this->threshold1   = threshold1;
	this->threshold2   = threshold2;
	this->apertureSize = apertureSize;
}

CannyEdgeFilter::~CannyEdgeFilter(void)
{
}

IplImage* CannyEdgeFilter::compute(const IplImage* im) {

	IplImage* canny = cvCreateImage( cvGetSize(im), 8, 1 );
	cvCanny( im, canny, threshold1, threshold2, apertureSize );

	return canny;
}